package com.world.tg.util;

import org.apache.shiro.crypto.SecureRandomNumberGenerator;
import org.apache.shiro.crypto.hash.Md5Hash;

import java.util.HashMap;
import java.util.Map;

public class EncryptionUtil {
    public Map<String,String> encryption(String password){
        String salt = new SecureRandomNumberGenerator().nextBytes().toHex();
        String pwd = new Md5Hash(password, salt, 1).toString();
        Map<String, String> map = new HashMap<String,String>();
        map.put("salt",salt);
        map.put("password",pwd);
        return map;
    }
}
